package com.ruoyi.app.converter;

import com.ruoyi.app.domain.message.MessageDetail;
import com.ruoyi.app.domain.message.MessageSimple;
import com.ruoyi.service.message.entity.UserMessageEntity;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**
 * <p>
 * 作用：公司信息转换器
 * </p>
 *
 * @author Zane
 * @since 2025-10-05 8:05
 */
@Mapper(uses = {})
public interface MessageConverter {

  MessageConverter INSTANCE = Mappers.getMapper(MessageConverter.class);

  /**
   * 转换为简单对象
   */
  @Mappings({})
  MessageSimple toSimple(UserMessageEntity entity);

  /**
   * 转换为详细
   */
  @Mappings({
      @Mapping(target = "content", ignore = true)
  })
  MessageDetail toDetail(UserMessageEntity entity);
}
